home *** CD-ROM | disk | FTP | other *** search
- Path: news.cs.utwente.nl!not-for-mail
- From: Angelo Starink <starink@cs.utwente.nl>
- Newsgroups: comp.lang.c++
- Subject: Another class/function pointer problem...
- Date: Mon, 01 Apr 1996 16:01:53 +0200
- Organization: University of Twente, Dept. of Computer Science
- Distribution: world
- Message-ID: <315FE1D1.E66@cs.utwente.nl>
- NNTP-Posting-Host: maas.cs.utwente.nl
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (X11; I; HP-UX A.09.01 9000/720)
-
- Hi All!
-
- Since I tried to use a callback function within an object, I'm
- suffering from the class/function pointer problem as well...
-
- Using the "static" trick it seemed like the problem was solved
- but now I can't get reach my class member variables:
-
- class Problem {
- public:
-
- static CALLBACK void fn(...,...,..);
- HWND the_window_using_this_object;
-
- };
-
-
- void CALLBACK Problem::fn(...,..) {
- ::MessageBox(the_window_using_this_object,"Whatever...", "Don't
- care",MB_OK);
- }
-
-
-
- The reason I need this is because I want to use callback functions for some
- audio stuff
- in Windows NT. In my opinion an object that is supposed to handle things
- about audio
- has no relation with a window:
-
- Problem::OpenInput() {
- waveInOpen(....,(DWORD) fn, 0, CALLBACK_FUNCTION);
- ...
- }
-
-
- When I try to compile this, Visual C++ 2.0 says:
- "'Problem::the_window_using_this_object' does not specify an object"
-
- Is there someone who has a solution to this problem?
- Thanks for your time,
-
- Stefan Jansen
-